package main

import "fmt"

func isNumber(n int) bool {
	var i, j, k int
	i = n % 10
	j = (n / 10) % 10
	k = (n / 100) % 10

	sum := i*i*i + j*j*j + k*k*k
	return sum == n
}

func main() {
	var n int
	var m int
	fmt.Scanf("%d %d", &n, &m)

	for i := n; i < m; i++ {
		if isNumber(i) {
			fmt.Println(i)
		}
	}
	// if isNumber(n) {
	// 	fmt.Println(n, "is shuxianhua")
	// } else {
	// 	fmt.Println(n, "is not shuxianhua")
	// }
	/* 输出结果
	PS C:\Users\yangqing\Documents\Gitee\go\src\02\work> .\eg2.exe
	100 999
	153
	370
	371
	407
	*/
}
